package com.override_重写;

public class Override03 {
    public static void main(String[] args) {
        person person = new person("张三",60);
        System.out.println(person.sey());

        student student = new student("李四", 50, 100, 201);
        System.out.println(student.sey());


    }
}

class person{
    private String name;
    private int age;

    public person(String name,int age){
        this.name = name;
        this.age = age;
    }
    public String sey(){
        return "姓名为"+name+"  年龄为"+age;
    }
}

class student extends person{
    double score;
    int id;
    public student(String name,int age,double score,int id){
        super(name,age);
        this.score = score;
        this.id = id;
    }

    public String sey(){
        return super.sey()+"  分数为"+score+"  学号为"+id;
    }
}